package com.bwie.list.service.impl;


import com.bwie.common.domain.po.Food;
import com.bwie.list.mapper.FoodMapper;
import com.bwie.list.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FoodServiceImpl implements FoodService {
    @Autowired
    private FoodMapper foodMapper;

    @Override
    public List<Food> findFoodList() {
        return foodMapper.findFoodList();
    }

    @Override
    public void addFood(Food food) {
        foodMapper.addFood(food);
    }

    @Override
    public Integer delFood(Integer foodId) {
        Integer i = foodMapper.delFood(foodId);
        if(i>0){
            System.out.println("账户余额不足");
        }
        return i;
    }
}
